
   var search_ipt = $(".search-1");
   console.log(search_ipt.val());
   var list_ele = document.getElementById("search-list");
$(function () {
    search_ipt.on("input",function () {
          $.ajax({
                url: "https://www.baidu.com/sugrec",
                data : {
                prod:"pc",
                from:"pc_web",
                wd:search_ipt.val()
          },
                dataType: "jsonp",  
                success: function (res) {
                      if (res.g instanceof Array) {
                            var html = res.g.map(function (
                                  item) {
                                  return `<li>${ item.q }</li>`
                            }).join("");
                            list_ele.innerHTML = html;
                      } else {
                            list_ele.innerHTML = "";
                      }
                }
          })
    })

})
        